package no.group.gowther.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import no.group.gowther.enums.OnePieceType;

import java.sql.Timestamp;
import java.util.Objects;

/**
 * @author ayatsuji
 * @date 2022-04-26 23:26
 * @since
 */
public class OnePiece {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    private OnePieceType type;
    private String index;
    private Timestamp createdAt;
    private Timestamp updatedAt;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public OnePieceType getType() {
        return type;
    }

    public void setType(OnePieceType type) {
        this.type = type;
    }

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    public Timestamp getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Timestamp updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OnePiece onePiece = (OnePiece) o;
        return id.equals(onePiece.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
